<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <%@include file="/WEB-INF/jsp/common/common.jsp"%>
	<script>
    $(function(){
    	$("#detailBtn").click(function(){
    		var rows = $('#dataTable').datagrid('getSelections');
    		if ( rows.length == 0 ) {
    			$.messager.alert('系统提示信息', "必须选择查看图片的流程实例信息",'error');
    		} else if ( rows.length > 1 ) {
    			$.messager.alert('系统提示信息', "只能选择一条流程实例信息查看图片",'error');
    		} else {
        		var row = rows[0];
        		$("#imgWindow").window("open");
        		$("#procMonitorImg").attr("src", "${APP_PATH}/proc/loadMonitorImg.do?id="+row.id);
    		}

    	});
    });
	</script>
</head>
<body class="easyui-layout">
    <div data-options="region:'center',border:false">
	<table id="dataTable"
	       class="easyui-datagrid"
	       title="流程实例分页查询表格"
		   data-options="
		        fit:true,
		        border:false,
		   		singleSelect:false,
		   		collapsible:false,
		   		fitColumns:true,
		   		rownumbers:true,
		   		url:'${APP_PATH}/proc/pageQueryForPI.do',
		   		method:'get',
				pagination:true,
				pageSize:10,
				toolbar:'#tb'
		   ">
		<thead>
			<tr>
			    <th data-options="field:'id',checkbox:true"></th>
				<th data-options="field:'piid',width:100">流程实例标识</th>
				<th data-options="field:'pdname',width:100">流程定义名称</th>
				<th data-options="field:'actname',width:100">当前活动名称</th>
				<th data-options="field:'status',width:100">状态</th>
			</tr>
		</thead>
	</table>
	</div>
	<div id="tb" style="padding:5px;height:auto">
		<div style="margin-bottom:5px">
			<a href="#" id="detailBtn" class="easyui-linkbutton" iconCls="icon-search" plain="true"></a>
		</div>
	</div>
	<div id="imgWindow" class="easyui-window" title="流程监控窗口"
	    data-options="
	        modal:true,
	        closed:true,
	        iconCls:'icon-search'"
	    style="width:500px;height:500px;padding:10px;">
        <img id="procMonitorImg" src="${APP_PATH}/images/loading.gif" />
	</div>	
</body>
</html>
